﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Final.App_Code;

namespace Final
{
    public partial class Update_student_info : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_update_Click(object sender, EventArgs e)
        {
            Student eve = new Student();
            
            eve.UpdateStudent(new Student(txtadmin.Text, txtname.Text, txtpassword.Text, txtcode.Text, txtcname.Text, txtmodule.Text, int.Parse(txtcontact.Text), txtemail.Text, txtRole.Text));
            string alertScript = String.Format("<Script Language='javascript'> alert('{0}');</script>", "Updated Successfully");
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Key", alertScript, false);  
        }

        protected void btn_clear_Click(object sender, EventArgs e)
        {
            Response.Redirect("update_student_info.aspx");
        }
    }
}